From af395ec10ec6fa01978817062bac69a45c51ba41 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 24 May 1993 19:54:15 +0000 Subject: [PATCH] (XTread_socket): For ConfigureNotify event, translate coordinates if send_event field is false provided the x-coord value is not large. --- src/xterm.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/xterm.c b/src/xterm.c index 9d85e1c9d28..8970185967c 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -3090,6 +3090,33 @@ XTread_socket (sd, bufp, numchars, waitp, expected) SET_FRAME_GARBAGED (f); } + if (! event.xconfigure.send_event + /* Sometimes we get root-relative coordinates + even tho send_event is 0. + This is not a perfectly reliable way of distinguishing, + but it does the right thing except in a case + where it doesn't hurt much to be wrong. */ + && event.xconfigure.x < 20) + { + Window win, child; + int win_x, win_y; + + XTranslateCoordinates (x_current_display, + + /* From-window, to-window. */ + event.xconfigure.window, ROOT_WINDOW, + + /* From-position, to-position. */ + event.xconfigure.x, + event.xconfigure.y, + &win_x, &win_y, + + /* Child of win. */ + &child); + event.xconfigure.x = win_x; + event.xconfigure.y = win_y; + } + f->display.x->pixel_width = event.xconfigure.width; f->display.x->pixel_height = event.xconfigure.height; f->display.x->left_pos = event.xconfigure.x; -- 2.30.2